﻿@page "/space/editdata"
@attribute [Authorize]
@inject NavigationManager NavigationManager
@inject IUserService _userService


@code {
    [CascadingParameter]
    private Task<AuthenticationState> authenticationStateTask { get; set; }

    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        if (firstRender)
        {
            var user = await authenticationStateTask;
            if (user.User.Identity.IsAuthenticated == false)
            {
                _userService.Login();
                return;
            }
            var UserId  = user.User.Claims.GetUserId();

            NavigationManager.NavigateTo("/space/editdata/" + UserId);
        }
    }
}
